Frediano Ziglio [Fri, 18 May 2018 10:41:57 +0000 (11:41 +0100)]
Fix flexible array buffer overflow
This is kind of a DoS, possibly flexible array in the protocol
causes the network size check to be ignored due to integer overflows.
The size of flexible array is computed as (message_end - position),
then this size is added to the number of bytes before the array and
this number is used to check if we overflow initial message.
/* Check if message fits in reported side */
if (nw_size > (uintptr_t) (message_end - start)) {
return NULL;
}
Following code:
- data__nelements == message_end - (start + 8)
- data__nw_size == data__nelements == message_end - (start + 8)
- nw_size == 8 + data__nw_size == 8 + message_end - (start + 8) ==
8 + message_end - start - 8 == message_end -start
- the check for overflow is (nw_size > (message_end - start)) but
nw_size == message_end - start so the check is doing
((message_end - start) > (message_end - start)) which is always false.
If message_end - start < 8 then data__nelements (number of element
on the array above) computation generate an integer underflow that
later create a buffer overflow.
Add a check to make sure that the array starts before the message ends
to avoid the overflow.
Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Signed-off-by: Christophe Fergeau <cfergeau@redhat.com>
[Salvatore Bonaccorso: Drop generated diff from commit messages causing
problem when applying with quilt. Remove addition to testsuite]
Gbp-Pq: Name Fix-flexible-array-buffer-overflow.patch
This commit changes to an actual new BIO method rather than reusing an
existing BIO method, and overriding only the fields that we need.
The approach before this commit would be causing issues with OpenSSL
1.1.0 as some of the fields we access have become opaque.
OpenSSL 1.1.0 does not seem to provide API to do that anymore.
There is no need to create a custom lookup to begin with. This method
here has no callbacks implemented and is doing nothing. The way I
understand it, it is used to retrieve a `lookup' object which provides a
certificate store. The SSL ctx provides also such a store.
Acked-by: Christophe Fergeau <cfergeau@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
Gbp-Pq: Name ssl-Stop-creating-our-own-X509_LOOKUP_METHOD.patch
As manual states below, text could be NULL for different reasons and
we should handle that. I've included a debug message to help
identifying possible regressions from wayland's clipboard.
"The text parameter to callback will contain the resulting text if
the request succeeded, or NULL if it failed. This could happen for
various reasons, in particular if the clipboard was empty or if the
contents of the clipboard could not be converted into text form."
Signed-off-by: Victor Toso <victortoso@redhat.com> Acked-by: Pavel Grunt <pgrunt@redhat.com>
Gbp-Pq: Name debian_843471-clipboard_Fix_crash_by_handling_error.patch
* New upstream release
* Update debian/copyright
* debian/control:
- Update Build-Depends libglib2.0-dev and libspice-protocol-dev
version required
- Remove Build-Depends on libgtk2.0-dev
- Bump Standards-Version to 3.9.8 (no changes)
- Use secure uri in vcs-*
* Remove libspice-client-gtk-2.0-* and python-spice-client-gtk,
upstream don't support gtk2 anymore
* Refresh explicitly-enable-subdir-objects.patch
* Bump SONAME and package name of libspice-client-gtk-3.0